html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0 0 100px;
  display: flex;
  gap: 20px;
  justify-content: center;
  background-color: aliceblue;
}

.section {
  display: flex;
}
.section .content-check:checked + .content {
  max-height: -moz-fit-content;
  max-height: fit-content;
}
.section .content-check:checked + .content .btn {
  left: auto;
  right: calc(50% - 50px);
}
.section .content-check:checked + .content .btn::after {
  transform: scaleY(-1);
}
.section .content-check:checked + .content .text {
  -webkit-mask: none;
          mask: none;
}
.section .content {
  width: 400px;
  max-height: 200px;
  overflow: hidden;
  border-radius: 4px;
  outline: 2px dashed royalblue;
}
.section .content::before {
  content: "";
  width: 100px;
  height: 100%;
  float: left;
}
.section .content pre {
  white-space: pre-wrap;
}
.section .content .text {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 15px;
  float: right;
  line-height: 1.5;
  margin: 0;
  margin-left: -100px;
  font-size: 18px;
  color: #232323;
  -webkit-mask: linear-gradient(red 150px, transparent 200px);
          mask: linear-gradient(red 150px, transparent 200px);
}
.section .content .btn {
  float: right;
  width: 100px;
  text-align: center;
  position: relative;
  left: calc(50% - 50px);
  transform: translateY(-100%);
  cursor: pointer;
}
.section .content .btn::before, .section .content .btn::after {
  content: "";
  height: 34px;
}
.section .content .btn::before {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
.section .content .btn::after {
  display: block;
  background-color: #666;
  transition: background-color 0.2s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E %3Cpath d='M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z'%3E%3C/path%3E %3C/svg%3E") center/24px 24px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E %3Cpath d='M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z'%3E%3C/path%3E %3C/svg%3E") center/24px 24px no-repeat;
}
.section .content .btn:hover::after {
  background-color: royalblue;
}